import axios from 'axios'
import qs from "qs";

export default {
  //新增项目
  saveProject(param) {
    return axios.post("/api/admin/project/setting/saveProject", qs.stringify(param));
  },
  //更新项目信息
  updateProject(param) {
    return axios.put("/api/admin/project/setting/updateProject?" + qs.stringify(param));
  },
  //删除项目信息
  deleteProject(param) {
    return axios.delete("/api/admin/project/setting/deleteProject?" + qs.stringify(param));
  },
  //获取用户分页列表
  getSysUserPage(params){
    return axios.get("/api/admin/project/setting/getSysUserPage", {params: params});
  },
  //根据项目id获取用户分页列表
  getSysUserPageWithPro(params) {
    return axios.get("/api/admin/project/setting/getSysUserPageWithPro", {params: params});
  },
  //获取用户列表
  getSysUserList(params) {
    return axios.get("/api/admin/project/setting/getSysUserList", {params: params});
  },
  //获取项目列表
  getProjectList(params) {
    return axios.get("/api/admin/project/setting/getProjectList", {params: params});
  },
  //获取项目分页列表
  getProjectPage(params) {
    return axios.get("/api/admin/project/setting/getProjectPage", {params: params});
  },
  //根据用户id获取项目列表
  getProjectListBySysUserId(params) {
    return axios.get("/api/admin/project/setting/getProjectListBySysUserId", {params: params});
  },
  //根据项目id获取用户列表
  getUserListByProjectInfoId(params) {
    return axios.get("/api/admin/project/setting/getUserListByProjectInfoId", {params: params});
  },
  //保存关联
  saveRel(params) {
    return axios.post("/api/admin/project/setting/saveRel", qs.stringify(params));
  },
  //保存用户关联
  saveRelProject(params) {
    return axios.post("/api/admin/project/setting/saveRelProject", qs.stringify(params));
  },
  //保存项目关联
  saveRelUser(params) {
    return axios.post("/api/admin/project/setting/saveRelUser", qs.stringify(params));
  },
  //根据项目主键、用户主键删除关联
  deleteRelUser(param){
    return axios.delete("/api/admin/project/setting/deleteRelUser?" + qs.stringify(param));
  }

}
